Tutorial to make double jumping:
Last updated: Jan. 14, 2006

Add this one statement in characterCreateEvent (you can put it practically anywhere you want):

doubleJumped=0      //whether the character double jumped yet

Open up characterStepEvent, find this code:

  {
    yAcc+=initialJumpAcc
    xAcc+=xVel/2
  }

and change it to:

  {
    yAcc+=initialJumpAcc
    xAcc+=xVel/2

//START OF DOUBLE JUMP CODE
    
    doubleJumped = 0
    
//END OF DOUBLE JUMP CODE

  }

Now find this code in characterStepEvent:

  //the "state" gets changed to JUMPING later on in the code
  state=FALLING
  //"variable jumping" states
  jumpButtonReleased=0
  jumpTime=0
}

And add this after the last curly bracket:

//START OF DOUBLE JUMP CODE

if doubleJumped=0 and isCollisionBottom(1)=0 and kJumpPressed
{
  doubleJumped=1
  if yVel>-2
    yVel=-2
  yAcc=-7
  state=FALLING
}

//END OF DOUBLE JUMP CODE
